using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;
using WindowsPhoneGame1.GamePlayStates;

namespace WindowsPhoneGame1.GameScreens
{
    class LevelSelectScreen : Screen
    {
        private int world = 0;

        public LevelSelectScreen(Game1 game, int world) : base(game)
        {
            NUMBER_OF_BUTTONS = 2;
        }

        public override void Initialize()
        {
            // call base.initialize first!
            base.Initialize();
            
            button_functions[0] = PressButton1;
            button_functions[1] = PressButton2;
        }

        public override void LoadContent()
        {
            button_texture[0] =
                game.Content.Load<Texture2D>("images/BoringButton");
            button_texture[1] =
                game.Content.Load<Texture2D>("images/BoringButton");

            base.LoadContent();
        }

        public override void UnloadContent()
        {
            base.UnloadContent();
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime)
        {
            game.GraphicsDevice.Clear(background_color);
            base.Draw(gameTime);
        }

        // Logic for each button click goes here
        protected override void take_action_on_button(int i)
        {
            button_functions[i](world, i);
        }

        /* button press functions */
        private bool PressButton1(int world, int level)
        {
            background_color = Color.Green;
            game.SetScreen(new GamePlayScreen(game, world, 0));
            return true;
        }

        private bool PressButton2(int world, int level)
        {
            background_color = Color.Yellow;
            game.SetScreen(new GamePlayScreen(game, world, 1));
            return true;
        }

    }
}
